const crypto = require('crypto')

const hashNode = val =>
	new Promise(resolve =>
		resolve(crypto.createHash('sha256').update(val).digest('hex')))
	.then(h => {
		return h
	})

hashNode(
	JSON.stringify({a: 'a', b: [1, 2, 3, 4], foo: {c: 'bar'}})
).then(console.log);
